<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人主页</title>
    <style>
        body {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
            overflow: hidden;
        }

        @font-face {
            font-family: 'MyCustomFont';
            src: url("https://www.xidaola1314.com/font.ttf") format('truetype');
        }

        .background {
            background-image: url('/static/applet/background.jpg');
            width: 100%;
            height: 100%;
            z-index: -1; /* 置于底层 */
        }

        .app-container {
            font-family: 'MyCustomFont', sans-serif; /* 应用自定义字体 */
            font-size: 16px;
            display: flex;
            flex-direction: column;
            align-items: center;
            height: 100%;
            width: 100%;
            position: fixed;
            top: 0;
            left: 0;
        }

        .background {
            width: 100vw;
            height: 100vh;
        }


        .bar-box {
            display: flex;
            align-items: center;
            margin-top: 10px;
            text-align: center;
        }

        .title {
            margin-top: 10px;
            font-size: 24px;
        }

        .info {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 10px;
        }

        .avatar {
            width: 70px;
            height: 70px;
            border-radius: 50%;
        }

        .name-box {
            display: flex;
            align-items: center;
        }

        .name-box .name {
            font-size: 20px;
        }

        .name-box .icon {
            width: 14px;
            height: 14px;
            margin-left: 5px;
        }

        .info .follow-box {
            display: flex;
            align-items: center;
            padding: 3px 5px;
            background-color: rgba(234, 86, 55, 0.8);
            border-radius: 20px;
            margin-left: 5px;
        }

        .cancel {
            background-color: #c9c5c5 !important;
        }

        .cancel .text {
            color: #636161 !important;
        }

        .main-box {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            height: 73vh;
            border-radius: 20px 20px 0 0;
            background: linear-gradient(to bottom, rgba(228, 67, 35, 0.8), rgba(216, 216, 216, 0.2));
            overflow: hidden;
            position: absolute;
            bottom: 0;
            padding-top: 20px;
        }

        .main-box .follow-box {
            display: flex;
            justify-content: space-between;
            width: 70%;
        }

        .main-box .follow-box .tab-box {
            flex: 1;
            text-align: center;
            font-size: 40rpx;
            color: #fff;
        }

        .scroll {
            display: flex;
            flex-direction: column;
            height: 60vh;
            width: 90vw;
        }

        .info-box {
            padding: 10px 15px;
            background: #fff;
            border-radius: 10px;
            margin-top: 10px;
        }

        .scroll .row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 16px;
            margin-top: 7px;
        }

        .scroll .row .text {
            width: 50%;
            white-space: nowrap; /* 不换行 */
            overflow: hidden; /* 超出隐藏 */
            text-overflow: ellipsis; /* 省略号 */
            flex-shrink: 0;
        / / 防止被挤压
        }

        .btn-box {
            display: flex;
            margin-top: 10px;
            justify-content: space-around;
        }

        .btn-box .btn {
            text-align: center;
            font-size: 18px;
            font-weight: bold;
            padding: 5px 25px;
            border-radius: 50px;
        }

        .xc {
            background-color: #F30E0E;
            color: #fff;
            margin-right: 10px;
        }

        .lx {
            background-color: #EDC80F;
        }


        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .modal-overlay .modal {
            background: #fff;
            width: 80%;
            padding: 10px;
            border-radius: 5px;
        }

        .modal-overlay .modal .modal-content {
            position: relative;
            background: #fff;
            padding: 10px;
            border-radius: 10px;
            max-height: 70vh;
        }

        .modal-overlay .modal .modal-content .close {
            position: absolute;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            right: 10px;
            top: 10px;
        }

        .modal-overlay .modal .modal-content .modal-title {
            position: absolute;
            font-size: 40rpx;
            color: #F30E0E;
            top: 30px;
            left: 10px;
        }

        .modal-overlay .modal .modal-content .row-box {
            margin-top: 50px;
        }

        .row-box .row {
            display: flex;
            width: 100%;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            font-size: 15px;
        }

        .row-box .row:last-child {
            margin-bottom: 0;
        }

        .row-box .text{
            width: 60px;
        }

        .row-box .input {
            margin-left: 50px;
            padding: 5px 10px;
            border: 1px solid #dad6d6;
            border-radius: 10px;
            flex: 1;
        }

        .row-box .sex-box {
            flex: 1;
            margin-left: 50px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .row-box .sex {
            flex: 1;
            padding: 5px 0;
            border: 1px solid #dad6d6;
            border-radius: 10px;
            margin-right: 10px;
            text-align: center;

        }

        .row-box .sex:last-child {
            margin-right: 0;
        }

        .row-box .active {
            border: 1px solid #F30E0E;
        }

        .photos-box {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            width: 100%;
            margin-top: 30px;
            max-height: calc(70vh - 30px);
        }

        .photos-box .photo {
            width: 130px;
            height: 130px;
            object-fit: cover;
            margin-top: 10px;
        }

        .close {
            cursor: pointer;
        }
        .err{
            position: fixed;
            left: 0;
            top: 0;
            background: rgba(0, 0, 0, 1);
            width: 100%;
            height: 100%;
            filter: alpha(opacity=100);
            opacity: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
            z-index: 99999;
            color: #fff;
        }
    </style>
</head>
<body>
<img src="/static/applet/background.jpg" class="background">

<div class="app-container">

    {if !$err_msg}
    <div class="info">
        <img class="avatar" src="{$info.avatar_path ? $info.avatar_path : '/static/applet/default_avatar.png'}" alt="Avatar"/>
        <div class="name-box">
            <div class="name">{$info.username}</div>
            {if $info.rz_status == 1}
            <img v-if="info.rz_status == 1" class="icon" src="/static/applet/name_icon.png" alt="Verified"/>
            {/if}
        </div>
        <div class="id">ID：{$info.id_num}</div>
    </div>

    <div class="main-box">
        <div class="follow-box">
            <div class="tab-box">
                <div class="text">关注我的</div>
                <div class="count">（{$info.follow_me_count}）</div>
            </div>
            <div class="tab-box">
                <div class="text">我关注的</div>
                <div class="count">（{$info.me_follow_count}）</div>
            </div>
        </div>

        <div class="scroll">
            <div class="info-box">
                <div class="set-box">
                    <div class="xx">基本信息</div>
                </div>
                <div class="row">
                    <div class="text">性别：{$info.gender}</div>
                    <div class="text">年份：{$info.birth_year}</div>
                </div>
                <div class="row">
                    <div class="text">居住：{$info.residence}</div>
                    <div class="text">户籍：{$info.hukou}</div>
                </div>
                <div class="row">
                    <div class="text">身高：{$info.height ? ($info.height . 'cm') : ''}</div>
                    <div class="text">体重：{$info.weight ? ($info.weight . 'kg') : ''}</div>
                </div>
                <div class="row">
                    <div class="text">职业：{$info.occupation}</div>
                    <div class="text">体型：{$info.body_type}</div>
                </div>
            </div>
            <div class="info-box">
                <div class="set-box">
                    <div class="xx">详细信息</div>
                </div>
                <div class="row">
                    <div class="text">婚况：{$info.marital_status}</div>
                    <div class="text">学历：{$info.education_level}</div>
                </div>
                <div class="row">
                    <div class="text">公司：{$info.company_type}</div>
                    <div class="text">年收入：{$info.annual_income}</div>
                </div>
                <div class="row">
                    <div class="text">住房：{$info.housing_status}</div>
                    <div class="text">车辆：{$info.car_status}</div>
                </div>
            </div>
            <div class="info-box">
                <div class="set-box">
                    <div class="xx">择偶要求</div>
                </div>
                <div class="row">
                    <div class="text">年龄：{$info.requirement_age}</div>
                    <div class="text">身高：{$info.requirement_height}</div>
                </div>
                <div class="row">
                    <div class="text">体型要求：{$info.requirement_body_type}</div>
                    <div class="text">婚姻状况：{$info.requirement_marital_status}</div>
                </div>
                <div class="row">
                    <div class="text">学历要求：{$info.requirement_education_level}</div>
                    <div class="text">年收入：{$info.requirement_annual_income}</div>
                </div>
                <div class="row">
                    <div class="text">居住地：{$info.requirement_residence}</div>
                    <div class="text">小孩要求：{$info.requirement_has_children}</div>
                </div>
                <div class="row">
                    <div class="text">购房：{$info.requirement_buying_status}</div>
                    <div class="text">购车：{$info.requirement_car_status}</div>
                </div>
            </div>
            <div class="btn-box">
                <div class="btn xc" onclick="openPhotosModal()">查看相册</div>
                <div class="btn lx" onclick="openContactModal()">联系方式</div>
            </div>
        </div>
    </div>

    <div id="photosModal" class="modal-overlay" style="display:none;" onclick="closePhotosModal()">
        <div class="modal" onclick="event.stopPropagation()">
            <div class="modal-content">
                <img class="close" src="/static/applet/close.png" onclick="closePhotosModal()" alt="Close"/>
                <div class="photos-box">
                    {volist name="info.photos_arr" id="vo"}
                    <img class="photo" src="{$vo.path}" alt="Photo"/>
                    {/volist}
                </div>
            </div>
        </div>
    </div>

    <!-- 联系方式无权查看弹框 START -->
    <div id="contactModal" class="modal-overlay" style="display:none;" onclick="closeContactModal()">
        <div class="modal" onclick="event.stopPropagation()">
            <div class="modal-content">
                <img class="close" src="/static/applet/close.png" onclick="closeContactModal()" alt="Close"/>
                <div class="photos-box" style="padding: 20px ;max-height: calc(70vh - 40px); overflow-y: auto">
                    <div>{$auto_content}</div>
                </div>
            </div>
        </div>
    </div>
    <!-- 联系方式无权查看弹框 END -->

    <div id="mask" style="display:none;" onclick="event.stopPropagation()">
        <div class="mask-content" onclick="event.stopPropagation()">
            <form onsubmit="formSubmit(event)">
                <div class="title">完善资料</div>
                <input type="file" class="avatar-btn"/>
                <input type="text" :value="avatar" name="avatar" style="display: none"/>

                <div class="row">
                    <div class="left">昵称</div>
                    <input type="text" :value="username" name="nickname" class="input" placeholder="请输入昵称"/>
                </div>

                <div class="row" style="border-top: none">
                    <div class="left">手机号</div>
                    <button type="button" class="mobile-btn" onclick="getPhoneNumber()">获取手机号</button>
                    <div class="input">{{ mobile}</div>
                </div>

                <div class="agree-box">
                    <input type="checkbox" :checked="is_agree" onclick="doAgree()" class="checkbox round color"/>
                    <div class="box">
                        阅读并接受
                        <span class="text" onclick="openPrivacy()">{{ privacyContractName}</span>
                    </div>
                </div>

                <div class="btn-box">
                    <button type="button" class="button cancel" onclick="this.show_login = false">取消</button>
                    <button type="submit" class="button save">保存</button>
                </div>
            </form>
        </div>
    </div>
    {else /}
    <div class="err">{$err_msg}</div>
    {/if}
</div>

<script>
    function back() {
        window.history.back();
    }

    function follow() {
        // 实现关注/取消关注的逻辑
    }

    function predivImg(imgPath) {
        // 实现预览图片的逻辑
    }

    function openPhotosModal() {
        document.getElementById('photosModal').style.display = 'flex';
    }

    function closePhotosModal() {
        document.getElementById('photosModal').style.display = 'none';
    }

    function openContactModal() {
        document.getElementById('contactModal').style.display = 'flex';
    }

    function closeContactModal() {
        document.getElementById('contactModal').style.display = 'none';
    }

    function formSubmit(event) {
        event.preventDefault();
        // 处理表单提交逻辑
    }
</script>
</body>
</html>
